<?php
	$titleId = $_GET['music'];
	//Lied informationen aus der DB ziehen
	$track = getMusicTitle($titleId);
	//Falls kein Track gefunden wurde
	if(empty($track)){
		?>
			<div id="card800">
				<span class="headline_title">Keine Musik gefunden</span>
				<div class="card_text">Bitte versuchen Sie es erneut.</div>
			</div>
		<?php
	}else{
?>
		<!-- Lied gefunden -->
		<div id="card800">
			<span class="song_title"><?php echo $track['title']; if(isset($track['author'])){echo " - ".$track['author'];} ?></span>
			<span class="song_album" style="font-size: 18px;"><?php if(isset($track['album'])){echo $track['album'];}?></span>
			<span class="song_info" style="font-size: 14px;">
				<?php 
					if(!empty($track['genre'])){echo $track['genre']." - ";} 
					if(!empty($track['year'])){echo $track['year']." - ";} 
					echo $track['length']." Min.";
				?>
			</span>
		</div>
		<div id="playercard">
			<audio controls preload="none" style="margin: 10px 20px; width: 760px;">
				<source src="music/<?php echo $track['link'];?>" type="audio/mpeg">
			</audio>
		</div>

	<?php
	}
	?>